home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / thistime.zip / THISTIME.DOC < prev   
Text File  |  1991-09-06  |  4KB  |  108 lines

  1. ─────────────────────────────────────────────────────────────────────────────
  2.  
  3.                             THISTIME.COM
  4.  
  5.      Utility to execute a BATch command line only once every "X" times.
  6.  
  7. ─────────────────────────────────────────────────────────────────────────────
  8.    As with most inventions, this utility was born out of necessity!
  9.    I blew-away several files because my FAT table got screwed up.
  10.    If I had run CHKDSK more often I would probably have caught the problem
  11.    MUCH SOONER.  Soooo, I added CHKDSK to my AUTOEXEC.BAT .... But ...
  12.    arrrrrgh!  ....  I couldn't STAND waiting for CHKDSK to finish it's job
  13.    EVERY TIME I BOOTED!
  14.  
  15.    Sooooooo, I wrote a little utility which I've included in my AUTOEXEC.BAT.
  16.    It tracks the number of times a process HASN't been run, and then, when
  17.    the quantity of times passed reaches a predetermined threshold,
  18.    THEN THE PROGRAM IS RUN!
  19.  
  20.    That means now my AUTOEXEC only runs CHKDSK once every 10 times I reboot ...
  21.  
  22.    This ability to only run a Batch command line once every "X" times may
  23.    be applied to any batch activity.
  24.  
  25. ─────────────────────────────────────────────────────────────────────────────
  26.  
  27.    To see a sample of how the utility runs ....
  28.  
  29.        ■ Execute TESTTHIS.BAT
  30.        ■ Keep pressing the enter key
  31.        ■ Every THIRD time through the BATch file it will print a
  32.          different message
  33.  
  34. ─────────────────────────────────────────────────────────────────────────────
  35.  
  36.    How it works ...
  37.  
  38.       ■ The program THISTIME.COM accepts two parameters
  39.  
  40.          ■ The first parameter is a CYCLE IDENTIFIER - meaning, this is
  41.            a word that is used to identify this particular cycle
  42.  
  43.          ■ The second parameter is a THRESHOLD COUNTER - this is the
  44.            quantity of times that the command should be ignored.
  45.  
  46.       ■ Add a line to your batch file
  47.  
  48.                    THISTIME  IDENTIFIER  COUNTER
  49.  
  50.       ■ The utility will examine it's records and determine if this
  51.         pass is the X'th pass. For example: if COUNTER is set to
  52.         5 and this is the 5th time THISTIME.COM has been run, then the
  53.         counter stored in THISTIME's data file is reset to 1.
  54.  
  55.         When the correct number of passes have been executed, THISTIME
  56.         will set ERRORLEVEL 1 .
  57.  
  58.       ■ If ERRORLEVEL 1 is set, your batch file should take appropriate
  59.         action.
  60.  
  61. ─────────────────────────────────────────────────────────────────────────────
  62.  
  63.    What THISTIME needs & uses ....
  64.  
  65.       ■ The utility automatically creates a file called THISTIME.DAT.
  66.  
  67.       ■ THISTIME.DAT is used to store the current counters for each
  68.         separate Cycle Identifier. There is no theoretical limit to the
  69.         number of cycle identifiers which may be maintained.
  70.  
  71.       ■ The DAT file is a simple text file which may be edited using
  72.         almost any text editor so long as the editor is capable of
  73.         non-document mode or some similar activity which doesn't alter
  74.         the text's high-byte.
  75.  
  76.       ■ The DAT file is created on the SAME DRIVE and SUBDIRECTORY
  77.         where the program THISTIME.DAT is stored. So long as your PATH
  78.         is pointing to where the program THISTIME.COM is stored then
  79.         the program is capable of finding the THISTIME.DAT data file.
  80.  
  81. ─────────────────────────────────────────────────────────────────────────────
  82.  
  83.    Notes .....
  84.  
  85.       ■ If you're interested in writing "bullet-proof" batch files,
  86.         then I've also included an additional ERRORLEVEL which may be
  87.         of interest.
  88.  
  89.       ■ If a DOS level error (like file locked or file write-protected)
  90.         happens, THISTIME will set ERRORLEVEL 255 which may then be
  91.         tested and acted upon by your batch file.
  92.  
  93. ─────────────────────────────────────────────────────────────────────────────
  94.  
  95. Author:    Frederick Volking / Work: (415)378-4640 / Home: (415)952-3450
  96.            425 Larch Avenue - South San Francisco, California  94080
  97.            Compuserve - 72000,2337
  98.  
  99. ─────────────────────────────────────────────────────────────────────────────
  100.  
  101. PUBLIC NOTICE: This utility is hereby placed into the Public Domain by
  102.                it's original author effective September 6th, 1991.
  103.  
  104.                                                   Enjoy ... Frederick
  105.  
  106. ─────────────────────────────────────────────────────────────────────────────
  107.  
  108.